package chapter6.chapter6_11;

class Person {
    private String name;
    private int age;

    public Person() {
        System.out.println("父类无参");
    }

    // getter/setter省略
}

class Student extends Person {
    private double score;

    public Student() {
        //super();
        // 调用父类无参,默认就存在，可以不写，必须再第一行
        System.out.println("子类无参");
    }

    public Student(double score) {
        //super();
        // 调用父类无参,默认就存在，可以不写，必须再第一行
        this.score = score;
        System.out.println("子类有参");
    }

}
